<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var iAge = 18;
        console.log(iAge);
        console.log(window.iAge);
        //
        if(window.confirm("您是本公司的员工吗？")){
            console.log("欢迎光临！");
            let sName = window.prompt("请输入用户名","guest");
            let sPass = window.prompt("请输入密码","");
            if("admin" == sName && "123" == sPass){
                console.log("登录成功！");
                // window.location.href = "http://www.baidu.com";
                // window.location.assign("http://www.baidu.com");
                window.document.write("您已成功登录，页面将会在   5  秒后自动跳转到xxxx");
                setTimeout(function(){
                    // window.location.href = "http://www.baidu.com";
                    window.location.replace("http://www.baidu.com");
                },5000);
            }
        }else{
            console.log("请联系管理员！");
        }
        
    </script>
</body>
</html>